// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

.team-hero {
  display: flex;
  position: relative;
  border: 2px solid $color-gray-10;
  border-radius: 8px;
  padding: 20px;
  margin: 0 1rem 0 21px;
  height: 154px;

  .text {
    flex-grow: 1;
    padding-left: 20px;
    .title {
      font-size: $fs24;
      font-weight: bold;
      color: $color-black;
    }
    .info {
      span {
        color: $color-gray-30;
        display: block;
      }
      padding-top: 10px;
    }
  }
  .close {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    svg {
      transform: rotate(45deg);
      width: 16px;
      height: 16px;
    }
  }
  .invite {
    align-self: flex-end;
    height: 40px;
    font-family: "worksans", sans-serif;
    width: 180px;
  }
  img {
    width: 274px;
    margin-bottom: -41px;
    @media (max-width: 1200px) {
      display: none;
      width: 0;
    }
  }
}

.hero-projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 30px;
  margin: 0 1rem 1rem 1.2rem;
  .tutorial,
  .walkthrough {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    border: 2px solid $color-gray-10;
    border-radius: 8px;
    min-height: 211px;

    .thumbnail {
      border-top-left-radius: 6px;
      border-bottom-left-radius: 6px;
      padding: 30px;
      display: block;
      background-color: #e0e4e9;
    }

    .text {
      padding: 30px;
      .title {
        color: $color-black;
        font-size: $fs24;
        font-weight: bold;
        margin-bottom: 8px;
      }
      .info {
        color: $color-gray-50;
        margin-bottom: 20px;
        font-size: $fs14;
      }
    }
    .action {
      font-family: "worksans", sans-serif;
      width: 180px;
      height: 40px;
    }
    .close {
      position: absolute;
      top: 0;
      right: 0;
      width: $size-5;
      cursor: pointer;
      display: flex;
      margin: 20px;
      justify-content: center;
      align-items: center;
      background-color: transparent;
      border: none;
      .icon {
        svg {
          fill: $color-gray-30;
          height: 16px;
          width: 16px;
          transform: rotate(45deg);
          &:hover {
            fill: $color-primary;
          }
        }
      }
    }

    @media (max-width: 1846px) {
      grid-template-columns: 190px 1fr;
    }
    @media (max-width: 1526px) {
      grid-template-columns: 1fr;
      .img {
        display: none;
        width: 0;
      }
    }
  }
  .walkthrough {
    .thumbnail {
      background-image: url("/images/walkthrough-cover.png");
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
    }
  }
  .tutorial {
    .thumbnail {
      background-image: url("/images/hands-on-tutorial.png");
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
    }
    .loader {
      display: flex;
      svg#loader-pencil {
        width: 31px;
      }
    }
  }
}

.dashboard-container {
  background-color: $color-dashboard;
  flex: 1 0 0;
  margin-right: $size-4;
  overflow-y: auto;
  width: 100%;
  &.dashboard-projects {
    user-select: none;
  }
  &.no-bg {
    background-color: transparent;
  }
  &.dashboard-shared {
    width: calc(100vw - 320px);
    margin-right: 50px;
  }

  &.search {
    margin-top: 10px;
  }
}

.dashboard-project-row {
  margin-bottom: $size-5;

  .project {
    align-items: center;
    background: $color-white;
    border-radius: $br-small;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: $size-4;
    padding: $size-2 $size-2 $size-2 $size-4;
    width: 99%;
    max-height: 40px;
    gap: $size-2;
    .project-name-wrapper {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      min-height: 32px;
      margin-left: $size-2;
    }
    .show-more {
      align-items: center;
      color: $color-gray-30;
      display: flex;
      font-size: $fs14;
      justify-content: space-between;
      cursor: pointer;
      .placeholder-icon {
        transform: rotate(-90deg);
        margin-left: 10px;
        svg {
          height: 14px;
          width: 14px;
          fill: $color-gray-30;
        }
      }
      &:hover {
        color: $color-primary-dark;
        svg {
          fill: $color-primary-dark;
        }
      }
    }

    .btn-secondary {
      border: none;
      padding: $size-2;
    }

    h2 {
      cursor: pointer;
      font-size: $fs18;
      line-height: 1rem;
      font-weight: 600;
      color: $color-black;
      margin-right: $size-1;
    }

    .edit-wrapper {
      margin-right: $size-4;
    }

    .info {
      font-size: $fs14;
      line-height: 1rem;
      font-weight: 400;
      color: $color-gray-60;
      margin-left: 0.75rem;
      @media (max-width: 760px) {
        display: none;
      }
    }

    .project-actions {
      display: flex;
      opacity: 0;
      margin-left: $size-6;

      .btn-small {
        height: 32px;
        margin: 0 $size-2;
        width: 32px;
      }
    }

    .pin-icon {
      cursor: pointer;
      display: flex;
      align-items: center;
      margin-right: 14px;
      background-color: transparent;
      border: none;
      svg {
        width: 15px;
        height: 15px;
        fill: $color-gray-20;
      }

      &.active {
        svg {
          fill: $color-gray-50;
        }
      }
    }
  }

  &:hover,
  &:focus,
  &:focus-within {
    .project-actions {
      opacity: 1;
    }
  }
}

.recent-files-row-title-info {
  color: $color-gray-60;
  line-height: 1rem;
  font-size: $fs14;
  font-weight: 400;
  @media (max-width: 880px) {
    display: none;
  }
}

.dashboard-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  font-size: $fs16;

  &.team-members {
    margin-bottom: 52px;
  }

  &.invitations {
    .table-row {
      display: grid;
      grid-template-columns: 43% 1fr 109px 12px;
    }
  }

  .table-header {
    display: grid;
    grid-template-columns: 43% 1fr 109px 12px;
    max-width: 1040px;
    background-color: $color-white;
    color: $color-gray-30;
    width: 100%;
    height: 40px;
    padding: 0px 16px;
  }

  .table-rows {
    display: flex;
    flex-direction: column;
    max-width: 1040px;
    width: 100%;
    margin-top: 16px;
    color: $color-black;
  }

  .table-row {
    display: flex;
    width: 100%;
    height: 45px;
    align-items: center;
    padding: 0px 16px;
  }

  .table-field {
    display: flex;
    align-items: center;

    .icon {
      padding-left: 10px;
      cursor: pointer;
    }
  }

  svg {
    width: 10px;
    height: 10px;
    fill: $color-black;
  }
}

.edit-wrapper {
  border: 1px solid $color-gray-10;
  border-radius: $br-small;
  display: flex;
  padding-right: $size-5;
  position: relative;

  input.element-title {
    border: 0;
    height: 30px;
    padding: 5px;
    margin: 0;
    width: 100%;
    background-color: $color-white;
  }

  .close {
    cursor: pointer;
    position: absolute;

    top: 1px;
    right: 2px;

    svg {
      fill: $color-gray-30;
      height: 15px;
      transform: rotate(45deg) translateY(7px);
      width: 15px;
      margin: 0;
    }
  }
}

.import-file-btn {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 2rem;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  width: 2rem;

  background: none;
  border: 1px solid $color-gray-20;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.4s;
  margin-left: 1rem;

  &:hover {
    background: $color-primary;
  }

  svg {
    width: 16px;
    height: 16px;
  }
}

.dashboard-templates-section {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 285px;
  transition: bottom 300ms;

  &.collapsed {
    bottom: -228px;
    transition: bottom 300ms;
  }

  .title {
    width: 100%;
    text-align: right;
    height: 56px;
    button {
      border: none;
      cursor: pointer;
      height: 58px;
      display: inline-block;
      line-height: 58px;
      text-align: center;
      border-top: 2px solid #e4e4e4;
      border-left: 2px solid #e4e4e4;
      border-right: 2px solid #e4e4e4;
      border-top-left-radius: 10px;
      border-top-right-radius: 10px;
      margin-right: 30px;
      background-color: $color-white;
      position: relative;
      z-index: 1;
      span {
        display: inline-block;
        vertical-align: middle;
        line-height: normal;
        font-size: 18px;
        font-weight: 600;
        color: $color-black;
        margin-left: 18px;
        margin-right: 10px;
        &.icon {
          margin-left: 10px;
          margin-right: 16px;
        }
      }
      svg {
        width: 12px;
        height: 12px;
      }
    }
  }

  .button {
    position: absolute;
    top: 133px;
    border: 2px solid #e0e4e9;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    width: 35px;
    height: 35px;
    cursor: pointer;
    background-color: $color-white;

    svg {
      width: 12px;
      height: 12px;
    }

    &.left {
      left: 0;
      margin-left: 43px;
    }

    &.right {
      right: 0;
      margin-right: 43px;
    }

    &:hover {
      border: 2px solid $color-primary;
    }
  }

  .content {
    background-color: $color-white;
    width: 200%;
    height: 229px;
    border-top: 2px solid #e4e4e4;
    border-left: 2px solid #e4e4e4;
    margin-left: 5px;
    position: absolute;

    .card-container {
      width: 275px;
      margin-top: 20px;
      display: inline-block;
      text-align: center;
      vertical-align: top;
      background-color: transparent;
      border: none;
      padding: 0;
    }

    .template-card {
      display: inline-block;
      width: 255px;
      font-size: 16px;
      color: #181a22;
      cursor: pointer;
      .img-container {
        width: 100%;
        height: 135px;
        margin-bottom: 15px;
        border-radius: 5px;
        border: 2px solid #e0e4e9;
        display: flex;
        justify-content: center;
        flex-direction: column;
      }

      .card-name {
        padding: 0 5px;
        display: flex;
        justify-content: space-between;
        height: 23px;
        svg {
          width: 16px;
          height: 16px;
        }
        span {
          font-weight: 500;
          font-size: $fs14;
        }
      }

      .template-link {
        border: 2px solid transparent;
        margin: 30px;
        padding: 32px 0;
      }

      .template-link-title {
        font-size: 14px;
        font-weight: 600;
        color: $color-gray-60;
      }

      .template-link-text {
        font-size: 12px;
        margin-top: $size-2;
        color: $color-gray-50;
      }

      &:hover {
        .img-container {
          border: 2px solid $color-primary;
        }
      }
    }
  }
}
